import modelExtend from '../../../utils/modelExtend';
import HttpModel from '../../../models/http';
let riskImpleRule = {
    namespace: 'riskImpleRule',
    state: {
    },
    effects: {
        *noticeList({ payload, callback }, { call, put }) {
            yield put({
                type: "save",
                payload: { loading: true },
            });
            const response = yield call(noticeList, payload);
            yield put({
                type: "save",
                payload: response,
            });
            yield put({
                type: "save",
                payload: { loading: false },
            });
            if (callback) callback(response);
        },
        *initData({ payload, callback }, { call, put }) {
            yield put({
                type: 'req',
                payload: {
                    pageData: {
                        rows: [],
                        list: [],
                        pagination: {},
                    },
                    data: {},
                },
            });
        },
    },
    reducers: {
        save(state, action) {
            return {
                ...state,
                ...action.payload,
            };
        },
    },
};
riskImpleRule = modelExtend(HttpModel, riskImpleRule);
export default riskImpleRule;